# Author:Foru

# 函数+模块=标准库

# from datetime import datetime # from...import ...从模块中导入函数，从标准库的datetime模块里请求了一个子模块也叫datetime
#
# odds = [ 1, 3, 5, 7, 9, 11, 13, 15, 17, 19,
#        21, 23, 25, 27, 29, 31, 33, 35, 37, 39,
#          41, 43, 45, 47, 49, 51, 53, 55, 57, 59]
# right_this_minute = datetime.today().minute # 调用生成一个值，这个值将赋给一个变量
# # import datetime
# # datetime.date.today() 今天的日期
# # datetime.date.today().day  日 今天日期的组成部分（日、月、年）
# # datetime.date.today().month 月
# # datetime.date.today().year 年
# # datetime.date.isoformat(datetime.date.today()) 今天的日期转换为一个字符串
# if right_this_minute in odds: # 先用in确定是否在里面
#     print("This minute seems a little odd.")
# else:
#     print("Not an odd minute.")
#
# # 扩展
# from datetime import datetime
# import random
# import time
# odds = [ 1, 3, 5, 7, 9, 11, 13, 15, 17, 19,
#        21, 23, 25, 27, 29, 31, 33, 35, 37, 39,
#          41, 43, 45, 47, 49, 51, 53, 55, 57, 59]
# for i in range(5): # 指示for循环要运行多少次，增加for循环
#     this_minute = datetime.today().minute
#     if this_minute in odds:
#         print("This minute seems a little odd.")
#     else:
#         print("Not an odd minute.")
#     wait_time = random.randint(1,60) # 生成两个给定值之间的一个随机数
#     time.sleep(wait_time) # sleep函数可以让执行暂停指定的秒数，这个函数是由标准库的time模块提供的

# 啤酒歌谣
word = "bottles"
for beer_num in range(99,0,-1):
    print(beer_num, word, "of beer on the wall.")
    print(beer_num, word, "of beer.")
    print("take one down.")
    print("pass it around.")
    if beer_num == 1:
        print("No more bottles of beer on the wall.")
    else:
        new_num = beer_num - 1
        if new_num == 1:
            word = "bottle"
        print(new_num, word, "of beer on the wall.")
    print()